<?php
require_once('kernel.inc');

if($AUTH->logedstatus === true)
{

   if($submit != false)
   {
      $user['pwd_1']  = isset($_REQUEST['pwd_1'])  ? $_REQUEST['pwd_1']  : false;
      $user['pwd_2']  = isset($_REQUEST['pwd_2'])  ? $_REQUEST['pwd_2']  : false;
      $user['name']   = isset($_REQUEST['name'])   ? $_REQUEST['name']   : false;
      $user['family'] = isset($_REQUEST['family']) ? $_REQUEST['family'] : false;
      $user['email']  = isset($_REQUEST['email'])  ? $_REQUEST['email']  : false;
      unset($_REQUEST);
      $user['pwd_1'] = prepare_str($user['pwd_1']);

      if($user['pwd_1'] !== $user['pwd_2'])
      {
         $user['pwd'] = false;
      } else
      {
         $user['pwd'] = $user['pwd_1'];
      }
      unset($user['pwd_1'], $user['pwd_2']);

      isEmail($user['email']);
      $user['name'] = prepare_str($user['name']);
      $user['family'] = prepare_str($user['family']);

      $SMARTY->assign('make', $AUTH->UpdateUserInfo($AUTH->user['id'], $user));

   } else
   {
      $SMARTY->assign_by_ref('user', $AUTH->GetUserInfo($AUTH->user['id']));
   }

   $SMARTY->display('admin.edituser.tpl.html');

} else
{
   $AUTH->frame_redirector();
}
?>